package com.fzdy.product.base.vo;

import lombok.Data;
import org.springframework.data.domain.PageRequest;

import java.util.List;

/**
 * Created by Administrator on 2017/3/27 0027.
 */
@Data
public class FrontPage<T> {
    private List<T> rows;
    private int pageCurrent = 1;
    private int pageSize = 20;
    private Long total = Long.valueOf(0L);
    private T search;
    public FrontPage() {}

    public static PageRequest getPage(FrontPage frontPage){
        return PageRequest.of(frontPage.getPageCurrent() - 1, frontPage.getPageSize());
    }
}

